Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
I've been working on a multiplayer game using Player.IO. It's somewhat based off the famous Pac-Man game.
However, I've been with the issue that some players might not play without having a look first, so there is my need for the guest. However, I can't find a way to play in the game without using an account. While I can make specific rules for the guests, I need to make that account.
I've written a small C# program to register this account with a simple button and then a line of code. This is what the register button code looks and should look like, according to the Player.IO documentation.
PlayerIO.QuickConnect.SimpleRegister(gameid, "guest", "guest", "guest", null, null, null, null, null, delegate (Client client) { }, delegate (PlayerIORegistrationError error) { });
I made sure to give the proper use of try and catch to find out any error that happens at the moment of registering the account.
try
{
PlayerIO.QuickConnect.SimpleRegister(gameid, "guest", "guest", "guest", null, null, null, null, null, delegate (Client client) { }, delegate (PlayerIORegistrationError error) { });
}
catch (PlayerIOError err1)
{
MessageBox.Show(Convert.ToString(err1), "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception err2)
{
MessageBox.Show(Convert.ToString(err2), "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
When I press the register button at the built program, the program will get stuck a while (normal). It'll then respond as normally. However, here comes the issue.
I won't get any error, meaning that the account must have been registered correctly. But when I check the list of accounts at the game, there is no account.
I checked the code for any issues, and it's not wrong.
I would like to know what's happening here.
And I'll be completely honest, no. This has nothing to do with Everybody Edits. I'm not making an Everybody Edits clone, for those who keep thinking.
EDIT: I've also used the PlayerIO.Authenticate method. It won't work either.
EDIT 2: I've made sure that the game uses SimpleUsers as the account system, so the type of account is not the issue. I'm using SimpleUsers since Basic account type is nothing more than a pain.
EDIT 3: I've also tried to register the account without an e-mail, since the e-mail is not really required to register an account. But it didn't work either.
EDIT 4: It's been solved. Thanks to hummerz5.
Offline
I really have no experience trying to make a game.
But on a possibly completely unrelated note: sometimes the guest here is called "simpleguest" for the ID. But the email and password (or username? I really don't recall) is guest/guest.
just a thought.
Offline
sometimes the guest here is called "simpleguest"
When you are using SimpleUsers, you don't need to add that "simple" before the username. If I added that, then the username (user ID) would be simplesimpleguest.
The e-mail is optional since the username is already guest. I'll try to register the account removing the e-mail since it's really not necessary to register an account, according to the Player.IO documentation.
EDIT: Didn't work either.
Offline
Offline
So, have you successfully registered any user as of yet?
Can't you just manually add it in the admin panel?
Also: you added the error delegate, but you aren't using it. oops!
Yes, I've been able to make my account. I've tested making another accounts, but it seems that the issue in particular is when the username is guest.
The delegate at the end was just an unnecessary overload which I had to add or the program wouldn't build because of an error telling me that there were not enough overloads. I am using try and catch to find the errors.
Offline
no bro. this is def. the issue. They'll either throw the error straight to you, or pass it to the delegate. They sure won't do both.
Logically, why would you want the error twice? So, the delegate's going to be the one to get any relevant PlayerIOErrors ... right? Or has it really been that long for me?
edit: normally i'd double check my sources by trying to screw up an EE registration and seeing where the error goes, but my VS Express shortcut is in my windows 10 start menu which still doesn't work.
I can't be bothered to WinKey+R, C:\program files\microsoft and then fiddle around... that's too tedious.
Offline
no bro. this is def. the issue. They'll either throw the error straight to you, or pass it to the delegate. They sure won't do both.
Logically, why would you want the error twice? So, the delegate's going to be the one to get any relevant PlayerIOErrors ... right? Or has it really been that long for me?
Yes. Exactly what I needed.
What I did was to move the error box code to the delegate. As soon as I did that, I got the errors. It ended in that the e-mail address was invalid.
I replaced then the e-mail with [email protected] since to log in I'll use the username guest on the same string.
And then it worked. Not using the delegate was my error. Thank you.
Also, I didn't use Visual Studio nor Windows. I'm using Ubuntu and there's a package made to run C# code. I built my program there with the DLL. Why the need for Windows when using this way it's possible to build even EE bots for Linux?
Offline
[ Started around 1739047321.9496 - Generated in 0.071 seconds, 12 queries executed - Memory usage: 1.46 MiB (Peak: 1.6 MiB) ]