mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-03 16:16:38 -04:00
asdfasdf
This commit is contained in:
@@ -46,6 +46,7 @@ local function helloFor(game, linkType, player)
|
||||
local hello = Handshake.hello(handshakeView(game), nil)
|
||||
hello.generation = Game3Link.GENERATION
|
||||
hello.type = Game3Link.HELLO
|
||||
hello.ruleset = Handshake.DEFAULT_RULESET
|
||||
local name, trainerId, gender = localPlayer(game)
|
||||
if type(player) == "table" then
|
||||
if player.name ~= nil then name = player.name end
|
||||
|
||||
@@ -250,6 +250,18 @@ strict:update(0)
|
||||
check(not strict:isOpen(), "a peer built on another cache is refused")
|
||||
eq(strict.reason, "cache_version_mismatch", "and says why")
|
||||
|
||||
local Handshake = require("src.link.Handshake")
|
||||
local realRuleset = Handshake.ruleset
|
||||
Handshake.ruleset = function() return "gen1_modern" end
|
||||
local r7c = FakeRelay.room({ seats = 2 })
|
||||
local mixed = Game3Link.attach(FakeRelay.transport(r7c, 0), { game = game })
|
||||
local otherHello = Game3Link.hello(game, Game3Link.LINKTYPE.BATTLE)
|
||||
Handshake.ruleset = realRuleset
|
||||
eq(otherHello.ruleset, Handshake.DEFAULT_RULESET, "the Gen 1 RULESET option never reaches a FireRed hello")
|
||||
r7c:session(1):send(otherHello)
|
||||
mixed:update(0)
|
||||
check(mixed:isOpen() and mixed:isReady(), "so two players with different Gen 1 rulesets still link")
|
||||
|
||||
print("[test] 8. CloseLink tears the session down and the peer hears it")
|
||||
Link.reset()
|
||||
Link.attach(host)
|
||||
|
||||
Reference in New Issue
Block a user