本文整理汇总了C#中uLink类的典型用法代码示例。如果您正苦于以下问题:C# uLink类的具体用法?C# uLink怎么用?C# uLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
uLink类属于命名空间,在下文中一共展示了uLink类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: uLink_OnPlayerConnected
void uLink_OnPlayerConnected(uLink.NetworkPlayer player)
{
string loginName = player.loginData.Read<string> ();
bool isSlayer = player.loginData.Read<bool> ();
bool isVampire = player.loginData.Read<bool> ();
if ( isSlayer == true )
{
uLink.Network.Instantiate (player, SlayerProxyPref, SlayerOwnerPref, SlayerCreatorPref, GetPosition('s'), SlayerSpawnLocation.rotation, 0, "SlayerPlayer");
roundController.CurrentSlayerPlayerNumber++;
GA.API.Design.NewEvent("New Slayer Player Connected");
}
else if ( isVampire == true )
{
uLink.Network.Instantiate (player, VampireProxyPref, VampireOwnerPref, VampireCreatorPref, GetPosition('v'), VampireSpawnLocation.rotation, 0, "VampirePlayer");
roundController.CurrentVampirePlayerNumber++;
GA.API.Design.NewEvent("New Vampire Player Connected");
}
if (!roundController.anybodyInTheGame)
roundController.anybodyInTheGame = true;
if( !roundController.roundStarted )
if( ( roundController.CurrentSlayerPlayerNumber > 0 ) && ( roundController.CurrentVampirePlayerNumber > 0 ) )
{
roundController.roundStarted = true;
roundController.StartTheRound();
}
}
开发者ID:volkanb,项目名称:Vampire,代码行数:32,代码来源:NetworkSpawnController.cs
示例2: OwnerReceiveRemoteWantsStatusMessage
// ReSharper disable once UnusedMember.Local
protected void OwnerReceiveRemoteWantsStatusMessage(uLink.NetworkMessageInfo info)
{
if (networkView.isMine)
{
networkView.RPC("RemoteReceiveStatusMessage", info.sender, StatusMessage);
}
}
开发者ID:merveilles,项目名称:WaitingForHorus,代码行数:8,代码来源:Server.cs
示例3: uLink_OnPlayerConnected
public void uLink_OnPlayerConnected(uLink.NetworkPlayer player)
{
connectingPlayer = (NetUser)player.localData;
String playerSteamURL = "http://steamcommunity.com/profiles/" + connectingPlayer.userID.ToString();
WebClient wc = new WebClient ();
wc.DownloadStringCompleted += (sender, e) =>
{
userProfilePage = e.Result;
if (lockGroup != "none")
{
if (userProfilePage.IndexOf("http://steamcommunity.com/groups/" + lockGroup) == -1)
{
connectingPlayer.Kick(NetError.Facepunch_Kick_Ban, true);
}
}
Match vacMatch = Regex.Match(userProfilePage, @"^([0-9]{1,5}) day\(s\) since last ban$");
if (vacMatch.Success)
{
int daysSinceBan = Convert.ToInt32(vacMatch.Groups[1].Value);
if (daysSinceBan < minVacDays)
{
connectingPlayer.Kick(NetError.Facepunch_Kick_Ban, true);
}
}
};
wc.DownloadStringAsync(new Uri(playerSteamURL));
}
开发者ID:BARKx4,项目名称:GroupGate,代码行数:31,代码来源:GroupGateBootstrap.cs
示例4: uLink_OnHandoverTimeout
void uLink_OnHandoverTimeout(uLink.NetworkPlayer player)
{
//This code is needed to destroy the player object ([email protected]) in the new game server after the handover.
//This code is executed if the client fails to connect to the new game server (for any reason).
uLink.Network.DestroyPlayerObjects(player);
uLink.Network.RemoveRPCs(player);
}
开发者ID:smarthaert,项目名称:talimare,代码行数:7,代码来源:GameServer.cs
示例5: ReceiveSetConnectionQuality
// ReSharper disable once UnusedMember.Local
protected void ReceiveSetConnectionQuality(float quality, uLink.NetworkMessageInfo info)
{
if (Server == null || networkView == null) return;
if (info.sender == Server.networkView.owner || networkView.isMine)
{
_ConnectionQuality = quality;
}
}
开发者ID:merveilles,项目名称:WaitingForHorus,代码行数:9,代码来源:PlayerPresence.cs
示例6: uLink_OnNetworkInstantiate
protected void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo info)
{
mainNetworkView = info.networkView;
// override the instance's NetworkInsantiator Destroyer delegate.
oldDestroyer = mainNetworkView.instantiator.destroyer;
mainNetworkView.instantiator.destroyer = OverrideDestroyer;
}
开发者ID:johnearnshaw,项目名称:PhonoBlocks-Min,代码行数:8,代码来源:uLinkOverrideNetworkDestroy.cs
示例7: uLink_OnNetworkInstantiate
void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo msg)
{
Color color = msg.networkView.initialData.Read<Color>();
string name = msg.networkView.initialData.Read<string>();
BroadcastMessage("SetLabel", name, SendMessageOptions.DontRequireReceiver);
BroadcastMessage("SetColor", color, SendMessageOptions.DontRequireReceiver);
}
开发者ID:smarthaert,项目名称:talimare,代码行数:8,代码来源:PlayerProxy.cs
示例8: uLink_OnNetworkInstantiate
void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo msg)
{
uLink.NetworkPlayer myPlayer = uLink.Network.player;
myPlayer.localData = this;
playerColor = msg.networkView.initialData.Read<Color>();
playerName = msg.networkView.initialData.Read<string>();
BroadcastMessage("SetColor", playerColor, SendMessageOptions.DontRequireReceiver);
}
开发者ID:smarthaert,项目名称:talimare,代码行数:10,代码来源:PlayerOwner.cs
示例9: uLink_OnPlayerConnected
void uLink_OnPlayerConnected(uLink.NetworkPlayer player)
{
string loginName;
if (!player.loginData.TryRead<string>(out loginName)) loginName = "Nameless";
//Instantiates an avatar for the player connecting to the server
//The player will be the "owner" of this object. Read the manual chapter 7 for more
//info about object roles: Creator, Owner and Proxy.
uLink.Network.Instantiate(player, proxyPrefab, ownerPrefab, creatorPrefab, spawnLocation.transform.position, spawnLocation.transform.rotation, 0, loginName);
}
开发者ID:pixelbreakfast,项目名称:BoatPpl_old,代码行数:10,代码来源:AuthSpawnPrefab.cs
示例10: Set
public void Set(IDMain idMain, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info)
{
if (!(idMain is Character))
{
this.Set(idMain.GetRemote<HitBoxSystem>(), ref localPoint, ref localNormal, bodyPart, ref info);
}
else
{
this.Set((Character)idMain, ref localPoint, ref localNormal, bodyPart, ref info);
}
}
开发者ID:HexHash,项目名称:LegacyRust,代码行数:11,代码来源:QueuedShotDeathInfo.cs
示例11: uLink_OnNetworkInstantiate
void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo info)
{
int ownerViewId = info.networkView.initialData.Read<int>();
uLink.NetworkView slingshotNetworkView = uLink.NetworkView.Find(new uLink.NetworkViewID(ownerViewId));
slingshot = slingshotNetworkView.GetComponentInChildren<SlingshotOwner>();
slingshot.SetProjectile(this);
smoothRigidbody = GetComponent<uLinkSmoothRigidbodyImproved>();
disablePhysics();
transform.parent = slingshot.transform;
transform.position = slingshot.transform.position;
}
开发者ID:piinecone,项目名称:kingofkalimpong,代码行数:11,代码来源:ProjectileOwner.cs
示例12: uLink_OnPlayerConnected
void uLink_OnPlayerConnected(uLink.NetworkPlayer player)
{
Debug.Log("OnPlayerConnected() " + player.ipAddress + ":" + player.port);
bool grounded = GameController.Player.GetComponent<Animator>().GetBool(Registry.Animator.Grounded);
if(grounded)
{
GameController.Player.GetComponent<PlayerSync>().SendTrigger(Registry.Animator.Land);
GameController.Player.GetComponent<PlayerSync>().SendBool(Registry.Animator.Grounded, grounded);
}
}
开发者ID:davidsiekut,项目名称:BirdSimulator2015,代码行数:11,代码来源:NetworkManager.cs
示例13: uLink_OnPlayerDisconnected
void uLink_OnPlayerDisconnected(uLink.NetworkPlayer player)
{
if (cleanupAfterPlayers)
{
uLink.Network.DestroyPlayerObjects(player);
uLink.Network.RemoveRPCs(player);
// this is not really necessery unless you are removing NetworkViews without calling uLink.Network.Destroy
uLink.Network.RemoveInstantiates(player);
}
}
开发者ID:johnearnshaw,项目名称:PhonoBlocks-Min,代码行数:11,代码来源:uLinkSimpleServer.cs
示例14: uLink_OnNetworkInstantiate
private void uLink_OnNetworkInstantiate(uLink.NetworkMessageInfo info)
{
if (base.networkView.isMine)
{
this.uspeaker.SpeakerMode = SpeakerMode.Local;
}
else
{
this.uspeaker.SpeakerMode = SpeakerMode.Remote;
}
}
开发者ID:HexHash,项目名称:LegacyRust,代码行数:11,代码来源:VoiceCom.cs
示例15: base_OnPlayerDisconnected
private void base_OnPlayerDisconnected(uLink.NetworkPlayer player)
{
// Delay removing player until OnPlayerDisconnect has fired in plugin
if (player.GetLocalData() is NetUser)
{
NextTick(() =>
{
foreach (var plugin_field in onlinePlayerFields) plugin_field.Call("Remove", player);
});
}
}
开发者ID:906507516,项目名称:Oxide,代码行数:11,代码来源:RustLegacyPlugin.cs
示例16: Connect
public void Connect(uLink.HostData hostData, string playerName)
{
isRedirected = false;
uLink.NetworkConnectionError error = uLink.Network.Connect(hostData, "", playerName);
if (error != uLink.NetworkConnectionError.NoError)
{
SendMessage("uLink_OnFailedToConnect", error);
}
}
开发者ID:smarthaert,项目名称:talimare,代码行数:11,代码来源:GameClient.cs
示例17: uLink_OnPreStartNetwork
void uLink_OnPreStartNetwork(uLink.NetworkStartEvent nsEvent)
{
general.Override();
switch (nsEvent)
{
case uLink.NetworkStartEvent.Client: client.Override(); break;
case uLink.NetworkStartEvent.Server: server.Override(); break;
case uLink.NetworkStartEvent.CellServer: cellServer.Override(); break;
case uLink.NetworkStartEvent.MasterServer: masterServer.Override(); break;
}
}
开发者ID:pixelbreakfast,项目名称:BoatPpl_old,代码行数:12,代码来源:uLinkOverrideSettings.cs
示例18: OverrideDestroyer
private void OverrideDestroyer(uLink.NetworkView instance)
{
if (autoDestroyAfterMessage)
{
instance.BroadcastMessage(broadcastMessage, SendMessageOptions.DontRequireReceiver);
Destroy();
}
else
{
// if we're relying on the message receiver for cleanup, then make sure there is one.
instance.BroadcastMessage(broadcastMessage, SendMessageOptions.RequireReceiver);
}
}
开发者ID:johnearnshaw,项目名称:PhonoBlocks-Min,代码行数:13,代码来源:uLinkOverrideNetworkDestroy.cs
示例19: OnRPC
protected override bool OnRPC(string rpcName, uLink.BitStream stream, uLink.NetworkMessageInfo info)
{
string str;
char chr = rpcName[0];
if (!NGCInternalView.Hack.actionToRPCName.TryGetValue(chr, out str))
{
Dictionary<char, string> chrs = NGCInternalView.Hack.actionToRPCName;
string str1 = string.Concat("NGC:", chr);
str = str1;
chrs[chr] = str1;
}
return base.OnRPC(str, stream, info);
}
开发者ID:HexHash,项目名称:LegacyRust,代码行数:13,代码来源:NGCInternalView.cs
示例20: ReadFromBitStream
// BitStream Reader
public static object ReadFromBitStream(uLink.BitStream stream, params object[] args)
{
RankEntry myObj = new RankEntry();
//myObj.rankIndex = stream.ReadInt32();
//myObj.accountId = stream.ReadString();
myObj.name = stream.ReadString();
myObj.country = stream.ReadString();
myObj.bestRanking = stream.ReadInt32();
//myObj.totalDamage = stream.ReadInt64();
return myObj;
}
开发者ID:judah4,项目名称:battle-of-mages,代码行数:14,代码来源:RankEntry.cs
注:本文中的uLink类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论