<?php
sendButton
sendMtc
sendMst
?>
<?php
/reinit
?>
<?php
сигнатура проблемы:
APPCRASH
DCon.exe
0.0.0.0
app timestamp: 50c22758
module name: DCon.exe
module ver: 0.0.0.0
module crash timestamp: 50c22758
Exeption code: c0000005
Address: 000345cf
?>
<?php
typedef unsigned char byte;
?>
<?php
unsigned char
?>
<?php
SOCKET sock; // TCP Socket (most packets)
SOCKET sockudp; // UDP Socket (if requested, for NLP and MCI)
?>
<?php
void send_mtc (byte UCID,const char* Msg)
{
struct IS_MTC pack_mtc;
memset(&pack_mtc, 0, sizeof(struct IS_MTC));
pack_mtc.Size = sizeof(struct IS_MTC);
pack_mtc.Type = ISP_MTC;
pack_mtc.UCID = UCID;
sprintf( pack_mtc.Text, "%.127s\0", Msg );
insim->send_packet(&pack_mtc);
};
void send_mst (const char* Text)
{
struct IS_MST pack_mst;
memset(&pack_mst, 0, sizeof(struct IS_MST));
pack_mst.Size = sizeof(struct IS_MST);
pack_mst.Type = ISP_MST;
sprintf( pack_mst.Msg, "%.63s\0", Text );
insim->send_packet(&pack_mst);
};
?>
<?php
/**
* Send a packet
*/
bool CInsim::send_packet(void* s_packet)
{
byte Type = *((unsigned char*)s_packet+1);
switch(Type)
{
case ISP_BTN:
return send_button(s_packet);
break;
case ISP_MTC:
return send_mtc(s_packet);
break;
}
pthread_mutex_lock (&ismutex);
if (send(sock, (const char *)s_packet, *((unsigned char*)s_packet), 0) < 0)
{
pthread_mutex_unlock (&ismutex);
return false;
}
pthread_mutex_unlock (&ismutex);
return true;
}
/**
* Send a variable sized button
*/
bool CInsim::send_button(void* s_button)
{
struct IS_BTN *pack_btn = (struct IS_BTN*)s_button;
int text_len = strlen(pack_btn->Text);
int text2send;
if (text_len == 0)
text2send = 0;
else
text2send = (1+((text_len-1)/4))*4;
pack_btn->Size = 12 + text2send;
pthread_mutex_lock (&ismutex);
if (send(sock, (const char *)pack_btn, pack_btn->Size, 0) < 0)
{
pthread_mutex_unlock (&ismutex);
return false;
}
pthread_mutex_unlock (&ismutex);
return true;
}
/**
* Send a variable sized message to connect
*/
bool CInsim::send_mtc(void* s_mtc)
{
struct IS_MTC *pack_mtc = (struct IS_MTC*)s_mtc;
int text_len = strlen(pack_mtc->Text);
int text2send;
if (text_len == 0)
return false;
else if (text_len > 127)
return false;
text2send = text_len + 4 - text_len%4;
pack_mtc->Size = 8 + text2send;
pthread_mutex_lock (&ismutex);
if (send(sock, (const char *)s_mtc,*((unsigned char*)s_mtc), 0) < 0)
{
pthread_mutex_unlock (&ismutex);
return false;
}
pthread_mutex_unlock (&ismutex);
return true;
}
?>
<?php
char banfile[MAX_PATH];
if ( ( strstr(line,"/banlist=") != false ) and ( *(strstr(line,"/banlist=")) == 0 ) )
strcpy( banfile, line+8 );
else
strcpy( banfile, "data\\misc\\bans.ban" );
?>
<?php
fopen(banfile,"r");
?>
/banlist = bans.ban