Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

param charSet ignored in NettyUtils.writeStrings(Charset charSet, String... msgs) #30

Open
zhijunsheng opened this issue Dec 23, 2012 · 1 comment

Comments

@zhijunsheng
Copy link

When I read the source code of method writeStrings(..) of class NettyUtils in jetserver, it seems to me that this line

ChannelBuffer theBuffer = writeString(msg);

should be

ChannelBuffer theBuffer = writeString(msg, charSet);

because the param charSet is not used otherwise.

Here is the original code:

public static ChannelBuffer writeStrings(Charset charSet, String... msgs)
{
    ChannelBuffer buffer = null;
    for (String msg : msgs)
    {
        if (null == buffer)
        {
            buffer = writeString(msg,charSet);
        }
        else
        {
            ChannelBuffer theBuffer = writeString(msg); // <--------- line in question
            if(null != theBuffer)
            {
                buffer = ChannelBuffers.wrappedBuffer(buffer,theBuffer);
            }
        }
    }
    return buffer;
}

Excuse me I have another question:
How and where to ask question like "what is the recommended way to add signup, password changing etc. features when using jetserver"?

Thanks a lot for this great open source project!

@menacher
Copy link
Owner

I have fixed the issue, now. Binaries are not updated so please build from code. I have just now created a new google group for jetserver. You can raise such issues there. B.t.w user credentials managing is very simplistic in jetserver see issue/feature #22.
But let me try to explain here. Jetserver does not as such provide a "user interface" to add users, manage passwords etc since that is not its purpose, even though it can be a module written for it. One simplistic implementation can be like this. You store all your user information in say mysql and in jetserver when you get username password and room connection key while the LOG_IN event is received you can do "SELECT * FROM MY_USER_TABLE WHERE USER_NAME="username form LOG_IN" AND PASSWORD="password from LOG_IN"; If player is retrievable you go ahead with connection in the "LookupService" object else you disconnect. You can use whatever UI you want to manage users in the backend database you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants