Raised This Month: $51 Target: $400
 12% 

FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-26-2010 , 19:06   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #11

Ok ok, now i know. But what now? =)<br><br>PS. Orpheu is really excellent.<br>
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-26-2010 , 19:16   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #12

Quote:
Originally Posted by Sn!ff3r View Post
Ok ok, now i know. But what now? =)<br><br>PS. Orpheu is really excellent.<br>
You have to find a way of getting the steam id of who is joining or, if you can't maybe trying name + password from the info of the user so you know that he is an admin. Then kick anybody and if needed maybe issue a reconnect on the admin. It would be easy if those structures were implemented but they aren't. Remember that despite not being able to mess with those structures you can pass them to other functions. If you find a function that gives information that you want and that receives an argument of a function you are hooking, you can call that function and pass it that argument you received. Like:

PHP Code:
yourHook(structureNotImplemented,msg[])
{
   
OrpheuCall(someFunction,structureNotImplemented)

__________________
joaquimandrade is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-26-2010 , 19:20   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #13

Quote:
Originally Posted by joaquimandrade View Post
You have to find a way of getting the steam id of who is joining or, if you can't maybe trying name + password from the info of the user so you know that he is an admin. Then kick anybody and if needed maybe issue a reconnect on the admin. It would be easy if those structures were implemented but they aren't. Remember that despite not being able to mess with those structures you can pass them to other functions. If you find a function that gives information that you want and that receives an argument of a function you are hooking, you can call that function and pass it that argument you received. Like:

PHP Code:
yourHook(structureNotImplemented,msg[])
{
   
OrpheuCall(someFunction,structureNotImplemented)

This is already done by my code, but server call reject first. But thanks for this info
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-26-2010 , 19:25   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #14

PHP Code:


public OrpheuHookReturn:OnSV_RejectConnection(addr[], msg[], {Float,Sql,Result,_}:...)
{        
    
trim(msg)
    if(
equal(msg"Server is full."))
    {
        
        
kick_fresh()   
        return 
OrpheuSupercede
    
}
    
    return 
OrpheuIgnored   
    
    

Huh, now first kicks newest player and connect present player. But here i cant check userinfo, mhm.

SV_FindEmptySlot was called from SV_ConnectClient, but i can compare netaddr, because structure isnt implemented.
__________________
Join US - custom Zombie Server - Custom Addons:




Last edited by Sn!ff3r; 03-26-2010 at 19:28.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-26-2010 , 19:27   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #15

Quote:
Originally Posted by Sn!ff3r View Post
This is already done by my code, but server call reject first. But thanks for this info
About superceding SV_RejectConnection do as I told you a file with "pointer" , "char *". It is ok for testing. The problem then is that if the server triggers SV_RejectConnection for other reason with a different number of arguments it crashes so you have to do stuff like: Hook SV_ClientConnectPre and Post. In Pre hook some function that occurs before SV_RejectConnection and inside it Hook SV_RejectConnection. In ClientConnectPost unhook the first hook and the hook to SV_RejectConnection if it exists. You got it? Basically, you have to make that your hook to SV_RejectConnection happens only in the case you want it to.

Quote:
Huh, now first kicks newest player and connect present player. But here i cant check userinfo, mhm.
That's the problem. Good luck.
__________________

Last edited by joaquimandrade; 03-26-2010 at 19:30.
joaquimandrade is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-26-2010 , 19:31   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #16

So not matter - i'm waiting for more structures ;)<br>

EDIT: To register Pre, i must add OrpheuHookPre pharse at registering ?
__________________
Join US - custom Zombie Server - Custom Addons:




Last edited by Sn!ff3r; 03-26-2010 at 19:35.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-26-2010 , 19:40   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #17

Quote:
Originally Posted by Sn!ff3r View Post
So not matter - i'm waiting for more structures ;)<br>

Look one thing . In SV_CheckUserInfo that is called on SV_ClientConnect you have this:

PHP Code:
memcpy(&v32a10x14u);
  if ( !
NET_IsLocalAddress(*(_DWORD *)&v32) )
  {
    if ( *
sv_password[1] )
    {
      
v37 "none";
      
v36 sv_password[1];
      if ( 
Q_stricmp(v36"none") )
      {
        
v33 Info_ValueForKey(haystack"password");
        *(
_DWORD *)&v32 sv_password[1];
        if ( 
Q_strcmp(*(_DWORD *)&v32v33) )
        { 
This basically says: if the server is not local and has a password defined check if the user has entered the right password. You can try to:

  • Hook SV_ConnectClient pre and post.
  • In SV_ConnectClientPre, if the server is full, hook SV_CheckUserInfo post and NET_IsLocalAddress pre and SV_RejectConnection pre and set a password (with a pcvar) for the server that you have to share with admins.
  • Supercede NET_IsLocalAddress and make it return true.
  • Get the return of SV_CheckUserInfo and save it globally.
  • In SV_RejectConnection kick an user and supercede it if the value saved previously is 1.
  • In SV_ConnectClient post, unhook the stuff.

I don't know if this will work

Edit: Watching the code again i think there will be easier ways just with Info_ValueForKey. I just formatted my pc but I will test later after installing my stuff again.

Edit: nevermind my edit. Info_ValueForKey is for server stuff.

Edit: Another thing about my "solution" before. You want need to change NET_IsLocalAddress in a real server and probably making sv_lan 0 is enough
__________________

Last edited by joaquimandrade; 03-26-2010 at 19:47.
joaquimandrade is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-26-2010 , 19:54   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #18

Quote:
<ul><li> Hook SV_ConnectClient pre and post.</li><li> In SV_ConnectClientPre, if the server is full, hook
SV_CheckUserInfo post and NET_IsLocalAddress pre and
SV_RejectConnection pre and set a password (with a pcvar) for the
server that you have to share with admins.</li><li> Supercede NET_IsLocalAddress and make it return true.</li><li> Get the return of SV_CheckUserInfo and save it globally.</li><li> In SV_RejectConnection kick an user and supercede it if the value saved previously is 1.</li><li> In SV_ConnectClient post, unhook the stuff.</li></ul>
Make the code, not words! ;)<br>
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-27-2010 , 03:58   Re: FATAL ERROR (shutting down): NET_SendPacket: bad address type with Orpheu
Reply With Quote #19

I've been working on this and I advanced a little bit.
This script can retrieve the name and password from a joining user and kick a player that is in the server but the player joining still gets "Server is full". (So he has to connect again)

Don't care about the rest of the code just care about joining(name[],password[]). That function will be called when a user is joining a full server and inside it you should kick whoever you want if the name and password are from an admin,
Attached Files
File Type: sma Get Plugin or Get Source (orpheu.sma - 740 views - 2.5 KB)
File Type: zip stuff.zip (2.1 KB, 164 views)
__________________

Last edited by joaquimandrade; 03-27-2010 at 04:08.
joaquimandrade is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode