本文整理汇总了C#中NetworkMode类的典型用法代码示例。如果您正苦于以下问题:C# NetworkMode类的具体用法?C# NetworkMode怎么用?C# NetworkMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkMode类属于命名空间,在下文中一共展示了NetworkMode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public virtual void Start(Report Report)
{
InitializeRazor();
_report = Report;
_filePath = Report.FilePath;
_displayOrder = Report.DisplayOrder;
_networkMode = Report.NetworkMode;
Thread.CurrentThread.CurrentUICulture = Report.Culture;
bool replaceExisting = Report.ReplaceExisting;
if (!File.Exists(_filePath))
{
replaceExisting = true;
}
if (replaceExisting)
{
_extentSource = Extent.Source;
}
else
{
_extentSource = File.ReadAllText(_filePath);
}
_extentSource = _extentSource.Replace("<!--%SuiteStartedTime%-->", _report.StartTime.ToString());
}
示例2: HandshakePacket
public HandshakePacket(int protocolVersion, string hostname, ushort port, NetworkMode nextState)
{
ProtocolVersion = protocolVersion;
ServerHostname = hostname;
ServerPort = port;
NextState = nextState;
}
示例3: Start
void Start()
{
#if UNITY_IOS
serverConnect.SetActive(false);
gameConnectPanel.gameObject.SetActive(false);
connectPanel.gameObject.SetActive(true);
#endif
//logLevel = LogFilter.FilterLevel.Debug;
GameObject es = GameObject.Find("EventSystem");
GameObject.DontDestroyOnLoad(es);
isPause = false;
SingletonNM = this;
currentMode = NetworkMode.Level;
selectedDifficulty = selectedDifficulty = LevelEnum.Unselected;
//currentPanel = connectPanel;
lobbyPlayerArray = new ArrayList(maxPlayers);
gameplayerControllers = new ArrayList(maxPlayers);
disconnectedPlayerControllers = new ArrayList(maxPlayers);
userNameSet = new HashSet<string>();
levels = new ArrayList(maxPlayers);
for (int i = 0; i < maxPlayers; i++)
{
lobbyPlayerArray.Add(null);
gameplayerControllers.Add(null);
disconnectedPlayerControllers.Add(null);
levels.Add(LevelEnum.Unselected);
}
lobbySystemStartSetting();
citizenshipZeroTime = 0;
//StartCoroutine(startLatency());
//infoPanel.DisplayDisconnectError("Client error : ", StopClientClbk, ReconnectClinetClbk);
}
示例4: HandshakePacket
public HandshakePacket(int protocolVersion, string serverAddress, ushort port, NetworkMode nextState)
{
ProtocolVersion = protocolVersion;
ServerAddress = serverAddress;
Port = port;
NextState = nextState;
}
示例5: WritePacket
public NetworkMode WritePacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
{
stream.WriteVarInt(ProtocolVersion);
stream.WriteString(ServerHostname);
stream.WriteUInt16(ServerPort);
stream.WriteVarInt((int)NextState);
return NextState;
}
示例6: ReadPacket
public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
{
ProtocolVersion = stream.ReadVarInt();
ServerHostname = stream.ReadString();
ServerPort = stream.ReadUInt16();
NextState = (NetworkMode)stream.ReadVarInt();
return NextState;
}
示例7: ExtentReports
public ExtentReports(string FilePath, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst, NetworkMode NetworkMode = NetworkMode.Online)
{
this.FilePath = FilePath;
this.ReplaceExisting = ReplaceExisting;
this.DisplayOrder = DisplayOrder;
this.NetworkMode = NetworkMode;
Attach(new HTMLReporter());
}
示例8: Network
Network()
{
networkThread = null;
mode = NetworkMode.HOST;
chatBuffer = new System.Collections.Generic.Queue<Chat>();
gameBuffer = new System.Collections.Generic.Queue<Action>();
ip = "127.0.0.1";
port = 10101;
stream = null;
}
示例9: Networking
public Networking(Game game, ConnectionExitedDelegate ced, IPAddress ipAddress, int port, bool server)
{
this.game = game;
this.ced = ced;
this.ipAddress = ipAddress;
if (server)
{
this.networkMode = NetworkMode.SERVER;
this.server = new TCPServer(this, ipAddress, port);
}
else
{
this.networkMode = NetworkMode.CLIENT;
this.client = new TCPClient(this, ced, ipAddress, port);
}
}
示例10: MinecraftStream
public MinecraftStream(Stream stream, NetworkMode mode)
{
_stream = stream;
Mode = mode;
switch (Mode)
{
case NetworkMode.Modern:
_encoding = Encoding.UTF8;
break;
case NetworkMode.Classic:
_encoding = Encoding.ASCII;
break;
}
}
示例11: Start
void Start()
{
node = NetworkNode.node;
if (node == null) //if null, no networking, server controls it if there is networking
{
mode = NetworkMode.UNKNOWN;
StartCoroutine(LocalGoalSpawning());
}
else if(node is Server)
{
mode = NetworkMode.LOCALSERVER;
StartCoroutine(ServerGoalSpawning());
}
else if (node is Client)
{
mode = NetworkMode.REMOTECLIENT;
node.Subscribe(this);
}
}
示例12: Create
/// <summary>
/// Create a new Minecraft Instance
/// </summary>
/// <param name="login">The username to use when connecting to Minecraft</param>
/// <param name="password">The password to use when connecting to Minecraft (Ignore if you are providing credentials)</param>
/// <param name="mode"></param>
/// <param name="nameVerification">To connect using Name Verification or not</param>
/// <param name="serverSalt"></param>
public IMinecraftClient Create(string login, string password, NetworkMode mode, bool nameVerification = false, string serverSalt = null)
{
ClientLogin = login;
ClientPassword = password;
UseLogin = nameVerification;
Mode = mode;
ServerSalt = serverSalt;
AsyncReceiveHandlers = new Dictionary<Type, Action<IAsyncReceive>>();
RegisterSupportedReceiveEvents();
World = new World();
Player = new Player();
Entities = new Dictionary<int, Entity>();
PlayersList = new Dictionary<string, short>();
_networkHandler = new NetworkHandler();
_networkHandler.Create(this);
return this;
}
示例13: Start
void Start()
{
node = NetworkNode.node;
if (node == null) //if null, no networking, server controls it if there is networking
{
mode = NetworkMode.UNKNOWN;
}
else if (node is Server)
{
mode = NetworkMode.LOCALSERVER;
node.Subscribe(this);
}
else if (node is Client)
{
mode = NetworkMode.REMOTECLIENT;
node.Subscribe(this);
}
for (int i = 0; i < charactersData.Length; i++)
{
charactersData[i].characterID = i;
}
}