Question by
sudoman281 · Sep 04, 2016 at 09:05 AM ·
c#pluginmasterservermaster server
Own MasterServer prblem
Hello, I setted up my own Unity Master Server, but I am still getting this problem:
Internal error while connecting tomaster server. Too many connected peers.
After player created the server I get this error:
The connection request to 81.201.63.53:50005 failed. Are you sure the server can be connected to?
BTW. I am sure that this is my ip :D. Here is my console log:
Sent 1464 bytes to port 25001
Sent 15 bytes to port 25001
Sent 91 bytes to port 25001
Sent 1464 bytes to port 61651
Sent 15 bytes to port 25001
Sent 15 bytes to port 61651
Sent 91 bytes to port 61651
Sent 44 bytes to port 25001
Sent 24 bytes to port 25001
04-09-2016 11:01:03 INFO New connection established to 81.201.63.53:25001
Sent 15 bytes to port 25001
04-09-2016 11:01:03 INFO Update row request from 81.201.63.53:25001
Sent 32 bytes to port 25001
04-09-2016 11:01:03 DEBUG Version 2.0.0 connected
04-09-2016 11:01:03 DEBUG Table QZJBMU created.
04-09-2016 11:01:03 INFO Sent row ID 0 in QZJBMU to host at 81.201.63.53:25001
04-09-2016 11:01:03 DEBUG Updating, inserting 0 at column 1072693248
04-09-2016 11:01:03 DEBUG Updating, inserting test at column 5
04-09-2016 11:01:03 DEBUG Updating, inserting 0 at column 1072693248
Sent 27 bytes to port 25001
04-09-2016 11:01:03 DEBUG Updating, inserting 0 at column 1077215232
04-09-2016 11:01:03 DEBUG Updating, inserting 0 at column 0
04-09-2016 11:01:03 DEBUG Updating, injecting 81.201.63.53 at column 9
04-09-2016 11:01:03 DEBUG Updating, injecting 25001 at column 10
04-09-2016 11:01:03 DEBUG Updating, inserting This is a test game at column 11
04-09-2016 11:01:03 DEBUG Updating, inserting 36028966409499968 at column 12
04-09-2016 11:01:03 DEBUG Internal port is 25001 IPs set as 192.168.1.136
Sent 15 bytes to port 25001
Sent 15 bytes to port 61651
Sent 64 bytes to port 61651
Sent 24 bytes to port 61651
04-09-2016 11:01:03 INFO New connection established to 81.201.63.53:61651
04-09-2016 11:01:03 INFO Query request from 81.201.63.53:61651
04-09-2016 11:01:03 DEBUG Version 2.0.0 connected
04-09-2016 11:01:03 INFO Fetching existing table QZJBMU
04-09-2016 11:01:03 DEBUG Injecting 1 internal IPs: 04-09-2016 11:01:03
DEBUG Injecting -1178533435 internal IPs: 1 192.168.1.136
Sent 15 bytes to port 61651
Sent 436 bytes to port 61651
Sent 15 bytes to port 25001
Sent 32 bytes to port 25001
Sent 15 bytes to port 25001
Sent 32 bytes to port 25001
Sent 15 bytes to port 61651
Sent 32 bytes to port 61651
Sent 15 bytes to port 61651
Sent 15 bytes to port 25001
04-09-2016 11:01:13 ERROR No table name defined, during query/removal.
04-09-2016 11:01:13 ERROR Malformed packet from 81.201.63.53:25001, packet size 146 bits.
04-09-2016 11:01:13 INFO Failed to remove row for 81.201.63.53:25001 because table lookup failed
04-09-2016 11:01:13 INFO Connection with 81.201.63.53:61651 closed
04-09-2016 11:01:13 INFO Removing rows for IP 81.201.63.53:61651
04-09-2016 11:01:13 INFO 81.201.63.53:61651 has diconnected
Sent 15 bytes to port 25001
04-09-2016 11:01:13 INFO Connection with 81.201.63.53:25001 closed
04-09-2016 11:01:13 INFO Removing rows for IP 81.201.63.53:25001
04-09-2016 11:01:13 DEBUG Found row ID 1
04-09-2016 11:01:13 INFO Force removing row 1
04-09-2016 11:01:13 DEBUG Current address map count 0
04-09-2016 11:01:13 INFO Deleting unused table for QZJBMU
04-09-2016 11:01:13 INFO 81.201.63.53:25001 has diconnected
My network manager code:
using UnityEngine;
using System;
using System.Collections;
using UnityEngine.UI;
using Assets.Own.Util;
public class NetworkManagerStart : MonoBehaviour {
private System.Random random = new System.Random();
private const string _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
private bool refreshing;
public InputField gameNameInput;
private string gameNameInputted;
// Use this for initialization
void Start () {
MasterServer.ipAddress = "81.201.63.53";
MasterServer.port = 23466;
Network.natFacilitatorIP = "81.201.63.53";
Network.natFacilitatorPort = 50005;
}
// Update is called once per frame
void Update()
{
if (MasterServer.PollHostList().Length != 0)
{
Debug.Log("!=0");
Preferences.hostData = MasterServer.PollHostList();
int i = 0;
while (i < Preferences.hostData.Length)
{
Debug.Log("Game name: " + Preferences.hostData[i].gameName);
i++;
Preferences.GameName = gameNameInputted;
Network.Connect(Preferences.hostData[0]);
}
MasterServer.ClearHostList();
}
}
public void joinServer()
{
gameNameInputted = gameNameInput.text;
MasterServer.ClearHostList();
MasterServer.RequestHostList(gameNameInputted);
}
public void startServer()
{
Preferences.GameName = RandomString(6);
Network.InitializeServer(20, 25001, !Network.HavePublicAddress());
MasterServer.RegisterHost(Preferences.GameName, "test", "This is a test game");
}
private string RandomString(int size)
{
char[] buffer = new char[size];
for (int i = 0; i < size; i++)
{
buffer[i] = _chars[random.Next(_chars.Length)];
}
return new string(buffer);
}
//Messages
void OnServerInitialized()
{
Debug.Log("Server initialized successfully");
MasterServer.ClearHostList();
Application.LoadLevel("lobby");
}
void OnConnectedToServer()
{
Debug.Log("Connected");
Application.LoadLevel("lobby");
}
}
Comment
Your answer
Follow this Question
Related Questions
Is it possible to access rig joints in C#? 0 Answers
OnAdRewarded not called after video completed 0 Answers
3 Questions about master server 0 Answers
Finding and editing private objects with plugins in c# 0 Answers
Which is the easiest way to access google play games services from our game ? 0 Answers