egametang/ET · error · RpcException
ERR_LocationLockOwnerMismatch
ERR_LocationLockOwnerMismatch
Error message
location lock owner mismatch type: {locationType} key: {key} requestActorId: {actorId} holdActorId: {state.ActorId} What it means
CreateBuff wraps its entire body in try/catch and re-throws a generic Exception carrying buffId, buffConfigId, casterId, with the real cause as InnerException. The visible message is a wrapper; the actual failure lives in e.InnerException — most often a missing BuffConfig, an AddChildWithId id collision, or a null config field (Flags/Effects/Duration).
Source
Thrown at Packages/cn.etetet.actorlocation/Scripts/Hotfix/Server/LocationComponentSystem.cs:431
locationInfo.TypeStates[locationType] = state;
}
if (IsLocked(state))
{
if (state.ActorId == actorId)
{
Log.Warning(
$"location lock idempotent type: {locationType} key: {key} actorId: {actorId} lockToken: {state.LockToken}");
return state.LockToken;
}
throw new RpcException(ErrorCode.ERR_LocationAlreadyLocked,
$"location lock already exists type: {locationType} key: {key} actorId: {state.ActorId} requestActorId: {actorId}");
}
if (exists && state.ActorId != default && state.ActorId != actorId)
{
throw new RpcException(ErrorCode.ERR_LocationLockOwnerMismatch,
$"location lock owner mismatch type: {locationType} key: {key} requestActorId: {actorId} holdActorId: {state.ActorId}");
}
long lockToken = IdGenerater.Instance.GenerateId();
long lockExpireTime = time > 0 ? self.GetSingleton<TimeInfo>().ServerNow() + time : 0;
state.ActorId = actorId;
state.LockToken = lockToken;
state.LockExpireTime = lockExpireTime;
locationInfo.TypeStates[locationType] = state;
try
{
await self.SaveInfoToDB(locationInfo);
}
catch
{
self = selfRef;
if (self != null)View on GitHub (pinned to 5cab01f7a8)
Solutions
- Inspect ex.InnerException for the true root cause before acting on the wrapper message.
- Verify a BuffConfig exists for buffConfigId in the exported config category before calling CreateBuff.
- Ensure buffId is unique among live children of this BuffComponent (no reuse while a buff is alive).
- Re-export spell/buff configs via Luban/ScriptableObject pipeline if config is stale or missing.
Example fix
// before
Buff buff = self.CreateBuff(buffId, buffConfigId, casterId);
// after
BuffConfig cfg = BuffConfigCategory.Instance.Get(buffConfigId);
if (cfg == null)
{
Log.Error($"buff config missing: {buffConfigId}, cannot create buff {buffId}");
return null;
}
Buff buff = self.CreateBuff(buffId, buffConfigId, casterId); Defensive patterns
Strategy: validation
Validate before calling
BuffConfig cfg = BuffConfigCategory.Instance.Get(buffConfigId);
if (cfg == null)
{
Log.Error($"cannot create buff: config {buffConfigId} not found");
return null;
} Try / catch
try
{
Buff buff = component.CreateBuff(buffId, buffConfigId, casterId);
}
catch (Exception ex)
{
Log.Error($"create buff failed {buffId} {buffConfigId} {casterId}: {ex.InnerException?.Message ?? ex.Message}");
} Prevention
- Resolve BuffConfig and assert non-null before CreateBuff.
- Guarantee buffId uniqueness among live buffs on the same BuffComponent.
- Always log/read InnerException — the outer message is only a wrapper.
- Re-export spell/buff configs after any config asset edit.
When it happens
Trigger: BuffConfig not resolvable for buffConfigId (buff.GetConfig() returns null/incomplete downstream); AddChildWithId<Buff,int>(buffId, buffConfigId) collides with an existing child id; a malformed config field (null Effects, bad Stack) throws during the flag/effect indexing loops.
Common situations: Buff config table (Luban export) missing the configId; spell/buff assets not re-exported after editing; duplicate buffId passed while a buff with that id is still alive; config Duration/TickTime fields invalid.
Related errors
- ERR_LocationLockNotFound
- ERR_LocationLockTokenMismatch
- btenv not found key: {key} {typeof(T).FullName}
- 不能把{value.GetType()}转换为{typeof (T)}
- condition root child count error: {node.Children.Count}
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/aa504d5d2632360c.
Report an issue: GitHub.