Crash

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Crash

Post by Gangrenous » Tue Aug 02, 2016 8:00 pm

Making a note, Scribble crashed the server by targeting himself on accident and doing a /spawn remove. Probably need to have a client check.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Crash

Post by Jabantiz » Tue Aug 02, 2016 9:41 pm

And this is why we need testers, most of us devs would never think to /spawn remove ourselves, should be a simple fix thanks for reporting it.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash

Post by Gangrenous » Wed Aug 03, 2016 5:43 am

This fixes it.

Code: Select all

		case COMMAND_SPAWN_REMOVE:{
			Spawn* spawn = client->GetPlayer()->GetTarget();
			if(spawn && !spawn->IsPlayer()){
				if(spawn->GetSpawnLocationID() > 0){
					if(database.RemoveSpawnFromSpawnLocation(spawn)){
						bool delete_spawn = false;
						if(sep && sep->arg[0][0] && sep->IsNumber(0)){
							if(atoi(sep->arg[0]) == 1)
								delete_spawn = true;
						}
						if(delete_spawn)
							client->GetCurrentZone()->RemoveSpawn(spawn, true, false);
						else
							spawn->SetSpawnLocationID(0);
						client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Successfully removed spawn from zone");
					}
					else
						client->SimpleMessage(CHANNEL_COLOR_RED, "Error removing spawn, see console window for details.");
				}
				else
					client->SimpleMessage(CHANNEL_COLOR_RED, "This spawn does not have a spawn group associated with it");
			}
			else{
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn remove");
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command is used for removing the targeted NPC or Object from the zone.");
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Optionally, you can supply a 1 after the command to despawn it as well.  IE /spawn remove 1");
			}
			break;
								  }
Resident Dirty Hippy

User avatar
Scribble
Team Member
Posts: 157
Joined: Wed Jun 22, 2016 5:30 am
EQ2Emu Server: Norrath Reborn
Characters: Scribe
Location: East Coast , USA
Contact:

Re: Crash

Post by Scribble » Wed Aug 03, 2016 10:39 am

Gangrenous wrote:This fixes it.

Code: Select all

		case COMMAND_SPAWN_REMOVE:{
			Spawn* spawn = client->GetPlayer()->GetTarget();
			if(spawn && !spawn->IsPlayer()){
				if(spawn->GetSpawnLocationID() > 0){
					if(database.RemoveSpawnFromSpawnLocation(spawn)){
						bool delete_spawn = false;
						if(sep && sep->arg[0][0] && sep->IsNumber(0)){
							if(atoi(sep->arg[0]) == 1)
								delete_spawn = true;
						}
						if(delete_spawn)
							client->GetCurrentZone()->RemoveSpawn(spawn, true, false);
						else
							spawn->SetSpawnLocationID(0);
						client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Successfully removed spawn from zone");
					}
					else
						client->SimpleMessage(CHANNEL_COLOR_RED, "Error removing spawn, see console window for details.");
				}
				else
					client->SimpleMessage(CHANNEL_COLOR_RED, "This spawn does not have a spawn group associated with it");
			}
			else{
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn remove");
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command is used for removing the targeted NPC or Object from the zone.");
				client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Optionally, you can supply a 1 after the command to despawn it as well.  IE /spawn remove 1");
			}
			break;
								  }
Thanks for the forward momentum on this !
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?

Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests