Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
SRB2
SRB2
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 244
    • Issues 244
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 67
    • Merge Requests 67
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • STJr
  • SRB2SRB2
  • Merge Requests
  • !980

Closed
Opened Jun 05, 2020 by LJ Sonic@LJSonic 
  • Report abuse
Report abuse

WIP: Fix "Variables X and Y have same netid" happening way too often

No need to use hashes for netvars, since they are always registered in the same order.

Edited Jun 08, 2020 by LJ Sonic
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b fix-cvar-conflicts origin/fix-cvar-conflicts

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout next
git merge --no-ff fix-cvar-conflicts

Step 4. Push the result of the merge to GitLab

git push origin next

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 5
  • Commits 1
  • Changes 1
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Golden @Golden commented Jun 05, 2020

    Lua can probably load netvars out of order, which can cause problems.

    Even if this code doesn't do it some code could probably be made that will...

    if players[consoleplayer] == <some number> then
        CV_RegisterVar{"var1", ...}
        CV_RegisterVar{"var2", ...}
    else
        CV_RegisterVar{"var2", ...}
        CV_RegisterVar{"var1", ...}
    end
    Lua can probably load netvars out of order, which can cause problems. Even if this code doesn't do it some code could probably be made that will... ```lua if players[consoleplayer] == <some number> then CV_RegisterVar{"var1", ...} CV_RegisterVar{"var2", ...} else CV_RegisterVar{"var2", ...} CV_RegisterVar{"var1", ...} end ```
  • toaster @toaster commented Jun 06, 2020
    Master

    I do not believe it is a solid approach. Specifically, it prevents replay compatibility between minor versions that add or remove cvars, whether that's versions of Lua mods or the base game in the case of Kart's netreplays, in a way that silently fails càstrophically.

    I do not believe it is a solid approach. Specifically, it prevents replay compatibility between minor versions that add or remove cvars, whether that's versions of Lua mods or the base game in the case of Kart's netreplays, in a way that silently fails càstrophically.
  • LJ Sonic @LJSonic commented Jun 08, 2020
    Master

    Lua can probably load netvars out of order, which can cause problems.

    Registering cvars is stuff that must be done at script load, and as such MUST be done in a deterministic order (like all other resources/hooks/etc basically). Any script that does otherwise (if it's even possible, that is) is effectively broken.

    Edited Jun 08, 2020 by LJ Sonic
    > Lua can probably load netvars out of order, which can cause problems. Registering cvars is stuff that must be done at script load, and as such MUST be done in a deterministic order (like all other resources/hooks/etc basically). Any script that does otherwise (if it's even possible, that is) is effectively broken.
  • LJ Sonic @LJSonic commented Jun 08, 2020
    Master

    I do not believe it is a solid approach. Specifically, it prevents replay compatibility between minor versions that add or remove cvars, whether that's versions of Lua mods or the base game in the case of Kart's netreplays, in a way that silently fails càstrophically.

    Actually, very fair point.

    I suppose we should either:

    1. keep using hashes, but use 32 bits instead of only 16,
    2. keep the new system, but add a header at the start of replay files, that maps the full names of each used cvar to a temporary ID.
    Edited Jun 08, 2020 by LJ Sonic
    > I do not believe it is a solid approach. Specifically, it prevents replay compatibility between minor versions that add or remove cvars, whether that's versions of Lua mods or the base game in the case of Kart's netreplays, in a way that silently fails càstrophically. Actually, very fair point. I suppose we should either: 1. keep using hashes, but use 32 bits instead of only 16, 2. keep the new system, but add a header at the start of replay files, that maps the full names of each used cvar to a temporary ID.
  • LJ Sonic @LJSonic

    marked as a Work In Progress

    Jun 08, 2020

    marked as a Work In Progress

    marked as a **Work In Progress**
    Toggle commit list
  • LJ Sonic @LJSonic commented Jun 08, 2020
    Master

    Well actually, the simplest way to handle replays is to use the cvar names directly in the replay files, instead of using numeric IDs of sort.

    Well actually, the simplest way to handle replays is to use the cvar names directly in the replay files, instead of using numeric IDs of sort.
  • James R.
    @james started a discussion on commit 6acd99c0 Jun 20, 2020
    • James R. @james

      mentioned in commit 32773b71

      Jun 20, 2020

      mentioned in commit 32773b71

      mentioned in commit 32773b71e0fafd620d08c9847b79d25941af449d
      Toggle commit list
    Please register or sign in to reply
  • James R. @james

    mentioned in merge request !1010 (merged)

    Jun 20, 2020

    mentioned in merge request !1010 (merged)

    mentioned in merge request !1010
    Toggle commit list
  • LJ Sonic @LJSonic

    closed

    Jun 20, 2020

    closed

    closed
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
2.2.5
Milestone
2.2.5
Assign milestone
Time tracking
3
Labels
Bruh moment Bugs Netcode noodles
Assign labels
  • View project labels
Reference: STJr/SRB2!980