Author Topic: Making a server GUI for PCDPmod - strange server starting bug  (Read 3879 times)

Bono

  • VM-68
  • Posts: 193
I am trying to handle server console to my application (make a server GUI), and, yes, I made it but only to this moment.

Code: [Select]
[********] Date: 2013-06-28
[02:41:03] Winsock Initialized.
[02:41:03] ===== Paintball II Initialized =====

Qhost not present.
Error: Error getting # of console events.

why server outputs that messages to me?
Code: [Select]
Qhost not present.
Error: Error getting # of console events.
What does that mean?

« Last Edit: June 28, 2013, 03:06:17 AM by Bono »

JMR

  • Map Committee
  • Autococker
  • Posts: 574
Re: strange server starting bug
« Reply #1 on: June 28, 2013, 02:21:35 AM »

omni

  • 68 Carbine
  • Posts: 319
Re: strange server starting bug
« Reply #2 on: June 28, 2013, 02:47:33 AM »
http://support.kaspersky.com/5350?el=88446
www.malwarebytes.org/
www.surfright.nl/

C:/windows/system32/drivers/etc/hosts

right click on hosts, edit with notepad,

look for any ip's that arent local ones,

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

thats ok ^^

Bono

  • VM-68
  • Posts: 193
Re: strange server starting bug
« Reply #3 on: June 28, 2013, 02:50:12 AM »
No, this is not trojan. I found this output messages in DP2 source, but I don't know what I'm doing wrong that I can see these messages.

conproc.c
Code: [Select]
// give QHOST a chance to hook into the console
if ((t = CCheckParm ("-HFILE")) > 0)
{
if (t < argc)
hFile = (HANDLE)atoi (ccom_argv[t+1]);
}

if ((t = CCheckParm ("-HPARENT")) > 0)
{
if (t < argc)
heventParent = (HANDLE)atoi (ccom_argv[t+1]);
}

if ((t = CCheckParm ("-HCHILD")) > 0)
{
if (t < argc)
heventChild = (HANDLE)atoi (ccom_argv[t+1]);
}


// ignore if we don't have all the events.
if (!hFile || !heventParent || !heventChild)
{
printf ("Qhost not present.\n");
return;
}

and

sys_win.c
Code: [Select]
/*
================
Sys_ConsoleInput
================
*/
char *Sys_ConsoleInput (void)
{
INPUT_RECORD recs[1024];
int dummy;
int /*ch,*/ numread, numevents;
unsigned char ch; // jittext

if (!dedicated || !dedicated->value)
return NULL;


for ( ;; )
{
if (!GetNumberOfConsoleInputEvents (hinput, &numevents))
Sys_Error ("Error getting # of console events.");

ViciouZ

  • Map Committee
  • Autococker
  • Posts: 2227
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #4 on: June 28, 2013, 03:15:17 AM »
hm. are you on windows 8?

Bono

  • VM-68
  • Posts: 193
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #5 on: June 28, 2013, 03:57:44 AM »
Yes. But when i'm running server via shortcut with parameters, server works good.

ViciouZ

  • Map Committee
  • Autococker
  • Posts: 2227
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #6 on: June 28, 2013, 05:32:14 AM »
Oh, sorry, wasn't reading this right.

Did a bit of research. Based on this, QHost was an application that does more or less what you are doing now - a server management console. It appears to have been supported by the official code, which checks to see if the game has been launched/hooked by another program. It detects this when your program launches it, but is confused because it is expecting some interface from QHost which is not used in your program - I guess you will have to look through the game source and work out how it works. Then you can either try and stop the game from trying to talk to QHost, or just emulate it.

http://web.archive.org/web/19980629203104/http://www.xoanan.com/qhost.htm

There are even downloads! :D

http://web.archive.org/web/20010405043729/www.xoanan.com/downloads.htm

Bono

  • VM-68
  • Posts: 193
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #7 on: June 28, 2013, 08:38:09 AM »
Hm, thanks.

Jitspoe, any comments/help for this?

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #8 on: July 01, 2013, 09:22:03 PM »
Not familiar with this at all, sorry.  It looks like it's expecting console input to be handled a certain way, and with the way you have things set up, calling GetNumberOfConsoleInputEvents is returning false.  I can't really look at the code right now.

Bono

  • VM-68
  • Posts: 193
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #9 on: August 10, 2013, 03:43:36 AM »
Any chances to look at this now? ;) I can make server GUI but actually this is not possible.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Making a server GUI for PCDPmod - strange server starting bug
« Reply #10 on: August 13, 2013, 07:54:07 PM »
On the first one, it looks like you have to specify ALL the parameters, -HFILE, -HPARENT, and -HCHILD.

Not sure if that will fix the second one.  GetNumberOfConsoleInputEvents() is a windows call, so I can't really say why that's failing.  Maybe this will give you some clues:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683207(v=vs.85).aspx