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

Player model, smooth(ish) movement, better clienttester #2

Merged
merged 11 commits into from
Jul 9, 2017

Conversation

nesrak1
Copy link
Member

@nesrak1 nesrak1 commented Jul 8, 2017

No description provided.

Copy link
Contributor

@Enflorence Enflorence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging this change, take a look at improving the request's code style and reusability. Please take a look at my inline comments and let me know if you have any questions or disagree with any of my findings.

@@ -37,6 +37,9 @@
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Subnautica\Subnautica_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="iTween">

This comment was marked as abuse.

This comment was marked as abuse.

public void UpdatePlayerPosition(String playerId, Vector3 position, Quaternion rotation)
{
GameObject player = GetPlayerGameObject(playerId);
player.SetActive(true);
player.transform.position = position;
player.transform.rotation = rotation;
iTween.MoveTo(player, iTween.Hash("position", position, "easetype", iTween.EaseType.easeInOutSine, "time", 0.05f));

This comment was marked as abuse.

player.transform.position = position;
player.transform.rotation = rotation;
iTween.MoveTo(player, iTween.Hash("position", position, "easetype", iTween.EaseType.easeInOutSine, "time", 0.05f));
iTween.RotateTo(player, iTween.Hash("rotation", rotation.eulerAngles, "easetype", iTween.EaseType.easeInOutSine, "time", 0.05f));

This comment was marked as abuse.

@@ -36,7 +36,13 @@ public GameObject GetPlayerGameObject(String playerId)

private GameObject createOtherPlayer(String playerId)

This comment was marked as abuse.

switch (cmd[0])
{
case "chat":
if (cmd.Count < 1) { Console.WriteLine($"\"{cmd[0]}\" does not take {cmd.Count - 1} arguments"); break; }

This comment was marked as abuse.

@@ -9,6 +13,8 @@ class Program
{
private static readonly string DEFAULT_IP_ADDRESS = "127.0.0.1";

private static Vector3 clientPos = new Vector3(-50f, -2f, -38f);

static void Main(string[] args)

This comment was marked as abuse.

Copy link
Member

@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nitpicks and ideas. Do with it as you like, and let me know what you think about them.


public void TakeCommand(string command)
{
String[] commandArray = Regex.Matches(Console.ReadLine(), @"[\""].+?[\""]|[^ ]+")

This comment was marked as abuse.

RegisterCommand(new HelpCommand(commands));
}

public void RegisterCommand(NitroxCommand command)

This comment was marked as abuse.

return;
}

if (args.Length > 4)

This comment was marked as abuse.

This comment was marked as abuse.

{
Name = "build";
Description = "Builds an object with the builder tool.";
Syntax = "build <techtype> <x> <y> <z> [xrot] [yrot] [zrot]";

This comment was marked as abuse.


public override void Execute(MultiplayerClient client, string[] args)
{
if (args.Length < 1)

This comment was marked as abuse.

float velX = curX - lastX;
float velY = curY - lastY;
client.clientPos += new Vector3(velX / 10f, 0, velY / 10f);
client.PacketSender.UpdatePlayerLocation(client.clientPos, Quaternion.identity, Optional<VehicleModel>.Empty());

This comment was marked as abuse.

{
public PosCommand()
{
Name = "drop";

This comment was marked as abuse.


public override void Execute(MultiplayerClient client, string[] args)
{
if (args.Length < 4)

This comment was marked as abuse.


private static int lastX = -1;

This comment was marked as abuse.


namespace NitroxClient.GameLogic
{
public class MovementHelper

This comment was marked as abuse.

@Sunrunner37 Sunrunner37 merged commit 4f4513a into SubnauticaNitrox:master Jul 9, 2017
nesrak1 pushed a commit to nesrak1/Nitrox that referenced this pull request Aug 29, 2017
Player model, smooth(ish) movement, better clienttester
Sunrunner37 pushed a commit that referenced this pull request Oct 6, 2017
Measurity referenced this pull request in Measurity/Nitrox Dec 31, 2019
Update to latest Harmony
Measurity referenced this pull request in Measurity/Nitrox Feb 1, 2020
dartasen pushed a commit to dartasen/Nitrox that referenced this pull request Mar 19, 2023
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

Successfully merging this pull request may close these issues.

None yet

4 participants