Digital Paint Discussion Board

Development => General Development => Topic started by: Bono on June 27, 2013, 08:36:40 PM

Title: Making a server GUI for PCDPmod - strange server starting bug
Post by: Bono on June 27, 2013, 08:36:40 PM
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?

Title: Re: strange server starting bug
Post by: JMR on June 28, 2013, 04:21:35 AM
Sounds like a trojan...

http://www.brighthub.com/computing/smb-security/articles/48525.aspx (http://www.brighthub.com/computing/smb-security/articles/48525.aspx)
Title: Re: strange server starting bug
Post by: omni on June 28, 2013, 04: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 ^^
Title: Re: strange server starting bug
Post by: Bono on June 28, 2013, 04: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.");
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: ViciouZ on June 28, 2013, 05:15:17 AM
hm. are you on windows 8?
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: Bono on June 28, 2013, 05:57:44 AM
Yes. But when i'm running server via shortcut with parameters, server works good.
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: ViciouZ on June 28, 2013, 07:32:14 AM
Oh, sorry, wasn't reading this right.

Did a bit of research. Based on this (http://vlsiweb.stanford.edu/~jsolomon/clan9/frames/truth/qsmack_FAQ.html#3.3.), 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
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: Bono on June 28, 2013, 10:38:09 AM
Hm, thanks.

Jitspoe, any comments/help for this?
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: jitspoe on July 01, 2013, 11: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.
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: Bono on August 10, 2013, 05:43:36 AM
Any chances to look at this now? ;) I can make server GUI but actually this is not possible.
Title: Re: Making a server GUI for PCDPmod - strange server starting bug
Post by: jitspoe on August 13, 2013, 09: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