Finally got it working but...

16 replies [Last post]
Posts: 25
CP: 0

I now have a problem with the server crashing when i create an account.

Quote:
Tried to get the UserAccount from IIPSocket `NetGore.Network.IPSocket`, but it has no tag.

Thats from the server message window.

When I try to create my own character with the spodi account, the server crashes, in debug i get this

name wrote:
Field 'permissions' doesn't have a default value

I what is the regular user account permission number?

Posts: 28
CP: 0

I had the same problem so i modified mysql stored procedure to something like this and it works now.

-- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
 
CREATE DEFINER=`root`@`localhost` FUNCTION `CreateUserOnAccount`(accountName VARCHAR(50), characterName VARCHAR(30), characterID INT) RETURNS varchar(100) CHARSET latin1
BEGIN
 
		DECLARE character_count INT DEFAULT 0;
		DECLARE max_character_count INT DEFAULT 3;
		DECLARE is_id_free INT DEFAULT 0;
		DECLARE is_name_free INT DEFAULT 0;
		DECLARE errorMsg VARCHAR(100) DEFAULT "";
		DECLARE accountID INT DEFAULT NULL;
 
		SELECT `id` INTO accountID FROM `account` WHERE `name` = accountName;
 
		IF ISNULL(accountID) THEN
			SET errorMsg = "Account with the specified name does not exist.";
		ELSE
			SELECT COUNT(*) INTO character_count FROM `character` WHERE `account_id` = accountID;
			SELECT `max_characters_per_account` INTO max_character_count FROM `game_constant`;
 
			IF character_count > max_character_count THEN
				SET errorMsg = "No free character slots available in the account.";
			ELSE
				SELECT COUNT(*) INTO is_id_free FROM `character` WHERE `id` = characterID;
 
				IF is_id_free > 0 THEN
					SET errorMsg = "The specified CharacterID is not available for use.";
				ELSE
					SELECT COUNT(*) INTO is_name_free FROM `user_character` WHERE `name` = characterName;
 
					IF is_name_free > 0 THEN
						SET errorMsg = "The specified character name is not available for use.";
					ELSE
						INSERT INTO `character` SET `id` = characterID, `name`	= characterName, `account_id`= 	accountID, `permissions`= 	0;
					END IF;
				END IF;
			END IF;
		END IF;
 
		RETURN errorMsg;
 
END$$

Posts: 1003
CP: 7799

Are you sure you're using the latest db.sql?

Posts: 25
CP: 0

Skye, It is the db.sql file that comes with teh .2.0 download. I will try out the altered procedure when i get home.

Posts: 1647
CP: 26119

You shouldn't have to change any of the code to get it to work. What is different in that altered procedure?

Posts: 25
CP: 0

Personally spodi, I'm not sure. Just got home. I will compare them and see what the difference is. Need to search the forums for the controls for top-down view. The controls on the wiki don't work except for attack and pic items up.

Posts: 1647
CP: 26119

crzyone9584 wrote:
The controls on the wiki don't work except for attack and pic items up.

Well that is why it is a wiki - so you can fix it when you see a problem. Wink

Posts: 25
CP: 0

Well once i figure it all out, and figure out how to update the wiki for top-down view i will most certainly will. Right now Im going through the code and everything.

Thanks for the calm replies and help. I know it most be a little annoying.

Posts: 1003
CP: 7799

No problem, have you seen my quadrillion topics about all kinds of things? I'm sure Spodi got a picture of me on his wall somewhere which he uses to play Darts Tongue

I will also do some TopDown wiki stuff as soon as the major changes settle down.

Posts: 25
CP: 0

Ok so for Spodi and asking what is different between the stored procedures that you have in ur sql dump and the one that is posted here.

tutkarz wrote:
INSERT INTO `character` SET `id` = characterID, `name` = characterName, `account_id`= accountID, `permissions`= 0;

The last insert into statement. Tutkarz added `permissions` = 0 where you had nothing and it ended with the accountID

As far as this goes. It works for creating a new character. I'm going to say it was left our of the dump or just not there all together.

As for top-down here is what works for me so far

Space - Picking up Items
Arrows - Walk
F keys for the quick menu.
CRTL - Attack

And here are the ones that don't work

Enter - Suppose to enter chat window
Alt - Interact with NPC/

Side not how would one go about editing the wiki. I know that there will be a lot of things that I ask that others will ask also. Figured I'd take the answers and SS of me doing it and put into the wiki so others can see it.

Posts: 1647
CP: 26119

Ahh, that makes sense. I was thinking "permissions" was MySQL related when tutkarz mentioned it - forgot there was a table with a "permissions" column (too many things in NetGore to keep track of!).

That issue will be fixed in the next release. Just have to set the field's default value to 0.

Posts: 25
CP: 0

Well will there be a new sql dump with the ne version to?

New keys i found that work

L-CRTL: Attacks
L-Shift & L-ALT - Interact with world! <--- Just found this one!
Arrows - Move

Still haven't found

Chat key
Jump

Also when you leave the window for more than a minute arrow keys won't work.

Posts: 67
CP: 0

There is no jump command in the topdown view.

Jump is the 'Up' arrow key though in the side-scrolling view. Smile

Posts: 1647
CP: 26119

crzyone9584 wrote:
Well will there be a new sql dump with the ne version to?

Every time a new version comes out that has changes to the database, there is a new database dump. Though if you want to preserve your data, you don't "have" to import the new database, just update your schema.

Posts: 25
CP: 0

Okay. So I'd have to go in the dump and change everything to update though.

Posts: 1647
CP: 26119

Yeah, but if you read the commit log, its pretty easy to see what needs to be done. The latest DB update just requires setting a default value on one field.

Posts: 25
CP: 0

Ok thanks for the information. I've finally got the system working some what. Keeps saying my account does not exist. lol Still learning c#. Wish the system was in vb.net, I understand that better. I would translate it to vb.net but i know nothing about tcp/upd programming yet lol. and im sure its against the license

Figured I'd stick with one thread.

So I'm messing around with the controls. Trycing to figure out why i need to hold shift plus alt to interact with the world. and trying to figure out what controls is for the chat in topdown.

But for attack i would like to use my left mouse click.
Is the default. What i want is this

_attack = new GameControlKeys("Attack", KeyCode.LControl);

_attack = new <span style="font-weight:bold"><span style="font-style:italic">Need to know what goes here!</span></span>("Attack", MouseButton.Left);

Only problem is Im not sure what GameControlKeys would be replaced. I've tried almost everything. Not sure if its even possible.