Raised This Month: $ Target: $400
 0% 

Sentry need to add validation!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-04-2014 , 17:28   Sentry need to add validation!
Reply With Quote #1

Server shutting down with errors, friend was told me: adding validation can fix it!

is_user_connected(id)

or

is_valid_ent(pEnt) // engine
pev_valid(pEnt) // fakemeta


help me to add it to source or prompt another solution please!




[18:41:13] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:58: "allexan<454><STEAM_0:0:433405097><>" entered the game
[18:41:15] L 06/04/2014 - 19:46:59: "allexan<454><STEAM_0:0:433405097><>" joined team "TERRORIST"
[18:41:15] L 06/04/2014 - 19:46:59: "Gamer_Call_Of_Duty V 3.0<450><STEAM_0:0:1312103449><TERRORIST>" attacked "CS2=EVILZCS=RO [30]<452><STEAM_0:0:591780245><CT>" with "m4a1" (damage "20") (damage_armor "5") (health "80") (armor "95")
[18:41:16] L 06/04/2014 - 19:46:59: "Gamer_Call_Of_Duty V 3.0<450><STEAM_0:0:1312103449><TERRORIST>" attacked "CS2=EVILZCS=RO [30]<452><STEAM_0:0:591780245><CT>" with "m4a1" (damage "20") (damage_armor "4") (health "60") (armor "91")
[18:41:16] Host_Error: WriteDest_Parm: not a client
[18:41:16] L 06/04/2014 - 19:47:00: Podbot mm - Experience Data not saved - number of waypoints 0.
[18:41:16] L 06/04/2014 - 19:47:00: Podbot mm - Visibility Table not saved - number of Waypoints - 0.
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Begin re-reading plugins list: /home/panel/clients/8714/cstrike/addons/metamod/plugins.ini
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: NoSeeVar
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: AMX Mod X
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: POD-Bot mm
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: dproto_EF
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: VoiceTranscoder
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Finished reading plugins list: /home/panel/clients/8714/cstrike/addons/metamod/plugins.ini; Found 5 plugins
[18:41:16] L 06/04/2014 - 19:47:00: [META] dll: Updating plugins...
[18:41:16] L 06/04/2014 - 19:47:00: [META] dll: Finished updating 14 plugins; kept 5, loaded 0, unloaded 0, reloaded 0, delayed 0
[18:41:16] L 06/04/2014 - 19:47:00: "[KRC] XALEER<-1><><SPECTATOR>" disconnected
[18:41:16] Dropped [KRC] XALEER from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "HECHOCHbIu --> [21_UA]<-1><><CT>" disconnected
[18:41:16] Dropped HECHOCHbIu --> [21_UA] from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Gamer_Call_Of_Duty V 3.0<-1><><TERRORIST>" disconnected
[18:41:16] Dropped Gamer_Call_Of_Duty V 3.0 from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "kazax<-1><><CT>" disconnected
[18:41:16] Dropped kazax from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "sasha shakyrin$$$<-1><><TERRORIST>" disconnected
[18:41:16] Dropped sasha shakyrin$$$ from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "::BT,FY::-Neks<-1><><TERRORIST>" disconnected
[18:41:16] Dropped ::BT,FY::-Neks from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Piston<-1><><CT>" disconnected
[18:41:16] Dropped Piston from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "CILLER<-1><><CT>" disconnected
[18:41:16] Dropped CILLER from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "anton18russ<-1><><TERRORIST>" disconnected
[18:41:16] Dropped anton18russ from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "CS2=EVILZCS=RO [30]<-1><><CT>" disconnected
[18:41:16] Dropped CS2=EVILZCS=RO [30] from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Neymar JR<-1><><TERRORIST>" disconnected
[18:41:16] Dropped Neymar JR from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "allexan<-1><><TERRORIST>" disconnected
[18:41:16] Dropped allexan from server
[18:41:16] Reason: Server shutting down
[18:41:17] configstore.cpp (1256) : Assertion Failed: Saving local config store failed during shutdown
[18:41:17] Assert( Assertion Failed: Saving local config store failed during shutdown ):/home/buildbot/buildslave_steam/steam_rel_client_linux/build/src/clientdll/configstore.cpp:1256
[18:41:17]
[18:41:17] configstore.cpp (97) : Assertion Failed: ConfigStore (InstallConfigStore) is dirty, and being destroyed, we're discarding data
[18:41:17] L 06/04/2014 - 19:47:01: Server shutdown
[18:41:17] L 06/04/2014 - 19:47:01: Log file closed
[18:41:17] L 06/04/2014 - 19:47:01: FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client
[18:41:17]
[18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client
Attached Files
File Type: sma Get Plugin or Get Source (sentry.sma - 664 views - 69.2 KB)

Last edited by Xaleer; 06-04-2014 at 17:29.
Xaleer is offline
Send a message via Skype™ to Xaleer
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-05-2014 , 00:04   Re: Sentry need to add validation!
Reply With Quote #2

can't look at source, if it's an entity use pev_valid
if it's a player check if he's connected and alive
aron9forever is offline
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-06-2014 , 08:54   Re: Sentry need to add validation!
Reply With Quote #3

Quote:
Originally Posted by aron9forever View Post
can't look at source, if it's an entity use pev_valid
if it's a player check if he's connected and alive

I don't know how to do this, please write me here)) error in lines 1055 and 1165...


if (!get_user_godmode(target) && hitRatio <= 0.0) {
line 1055 sentry_damagetoplayer(ent, sentryLevel, sentryOrigin, target)
}

----------------------------------------------------------------------------------------------------------------------------------------

if (newHealth <= 0) {
new targetFrags = get_user_frags(target) + 1
new owner = GetSentryPeople(sentry, OWNER)
new ownerFrags = get_user_frags(owner) + 1
set_user_frags(target, targetFrags) // otherwise frags are subtracted from victim for dying (!!)
line 1165 set_user_frags(owner, ownerFrags)
new contributors[3], moneyRewards[33] = {0, ...}
contributors[0] = owner
contributors[1] = GetSentryPeople(sentry, UPGRADER_1)
contributors[2] = GetSentryPeople(sentry, UPGRADER_2)
for (new i = SENTRY_LEVEL_1; i <= sentryLevel; i++) {
moneyRewards[contributors[i]] += g_SENTRYFRAGREWARDS[i]
}
for (new i = 1; i <= g_MAXPLAYERS; i++) {
if(!moneyRewards[i] || !is_user_connected(i) || cs_get_user_team(owner)!=cs_get_user_team(i)) continue
cs_set_user_money(i, cs_get_user_money(i) + moneyRewards[i])
if(cs_get_user_money(i)>16000) cs_set_user_money(i, 16000)
}

message_begin(MSG_ALL, g_msgDeathMsg, {0, 0, 0} ,0)
write_byte(owner)
write_byte(target)
write_byte(0)
write_string("sentry gun")
message_end()

scoreinfo_update(owner, ownerFrags, cs_get_user_deaths(owner), int:cs_get_user_team(owner))
set_msg_block(g_msgDeathMsg, BLOCK_ONCE)
}

Last edited by Xaleer; 06-06-2014 at 08:55.
Xaleer is offline
Send a message via Skype™ to Xaleer
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-06-2014 , 13:45   Re: Sentry need to add validation!
Reply With Quote #4

those errors are not crashing the server
this is: [18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client basically meaning MSG_ONES to non connected players

try this, if u have any more problems with runtimeerror add if(!is_user_connected(id)) before the line with the problem(remember to change id with what u need)
Attached Files
File Type: sma Get Plugin or Get Source (sentry.sma - 654 views - 69.3 KB)
aron9forever is offline
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-06-2014 , 19:48   Re: Sentry need to add validation!
Reply With Quote #5

Quote:
Originally Posted by aron9forever View Post
those errors are not crashing the server
this is: [18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client basically meaning MSG_ONES to non connected players

try this, if u have any more problems with runtimeerror add if(!is_user_connected(id)) before the line with the problem(remember to change id with what u need)
Thanks, but there are some mistakes when i compiled:

sentry.sma(1205) : warning 209: function "sentry_damagetoplayer" should return a value

sentry.sma(1464) : warning 217: loose indentation

scripting\sentry.sma(1465) : warning 217: loose indentation


can you fix them please?


And i add my dhudmessage include to this post, because with this site I can not download the plugin, it produces errors, because he is old here.

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/2/2/3/3/7/7/134189.attach(12) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.
Attached Files
File Type: inc dhudmessage.inc (3.4 KB, 180 views)
Xaleer is offline
Send a message via Skype™ to Xaleer
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-07-2014 , 06:30   Re: Sentry need to add validation!
Reply With Quote #6

Quote:
Originally Posted by Xaleer View Post
Thanks, but there are some mistakes when i compiled:

sentry.sma(1205) : warning 209: function "sentry_damagetoplayer" should return a value

sentry.sma(1464) : warning 217: loose indentation

scripting\sentry.sma(1465) : warning 217: loose indentation


can you fix them please?


And i add my dhudmessage include to this post, because with this site I can not download the plugin, it produces errors, because he is old here.

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/2/2/3/3/7/7/134189.attach(12) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.
those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing
aron9forever is offline
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-07-2014 , 09:55   Re: Sentry need to add validation!
Reply With Quote #7

Quote:
Originally Posted by aron9forever View Post
those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing
ok, Thank you! ;)
Xaleer is offline
Send a message via Skype™ to Xaleer
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-17-2014 , 10:52   Re: Sentry need to add validation!
Reply With Quote #8

Quote:
Originally Posted by aron9forever View Post
those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing
Today again server is down ... With such errors:

[AMXX] Displaying debug trace (plugin "sentry.amxx")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] sentry.sma::sentry_detonate ( line 988 )
[AMXX] [1] sentry.sma::createsentryhead ( line 521 )

Do not know what it could be?

Last edited by Xaleer; 06-17-2014 at 14:16.
Xaleer is offline
Send a message via Skype™ to Xaleer
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-17-2014 , 13:41   Re: Sentry need to add validation!
Reply With Quote #9

go to the line, and add above the line if(!is_user_alive(id)) return PLUGIN_HANDLED

so if you have at lne 521
xxx
createsentryhead(id)
xxx

make it

xxx
if(!is_user_alive(id)) return PLUGIN_HANDLED
createsentryhead(id)
xxx


also check index, if it's not "id" and it's something like "target "player" "iplayer" or whatever, use that
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Xaleer
Member
Join Date: May 2014
Location: Ukraine
Old 06-17-2014 , 14:27   Re: Sentry need to add validation!
Reply With Quote #10

Quote:
Originally Posted by aron9forever View Post
go to the line, and add above the line if(!is_user_alive(id)) return PLUGIN_HANDLED

so if you have at lne 521
xxx
createsentryhead(id)
xxx

make it

xxx
if(!is_user_alive(id)) return PLUGIN_HANDLED
createsentryhead(id)
xxx


also check index, if it's not "id" and it's something like "target "player" "iplayer" or whatever, use that
Sorry, but there is not so simple ... There are already conditions:

Code:
xxx
           if(!is_user_connected(creator))
	   {
521                   sentry_detonate(ent, true, false)
		   return
	   }
xxx
Code:
xxx
	      // Put the last sentry in the deleted entity's place
	       if(0 > (g_sentriesNum - 1) > MAXSENTRIES) return
988	       g_sentries[i] = g_sentries[g_sentriesNum - 1]
xxx
Xaleer is offline
Send a message via Skype™ to Xaleer
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 09:35.


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